package com.njym.java.security.admin.rest;

import com.njym.java.security.admin.biz.PostCommentBiz;
import com.njym.java.security.admin.entity.PostComment;
import com.njym.java.security.admin.entity.PostCommentVo;
import com.njym.java.security.common.msg.ObjectRestResponse;
import com.njym.java.security.common.rest.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("postComment")
public class PostCommentController extends BaseController<PostCommentBiz,PostComment> {

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    @ResponseBody
    public ObjectRestResponse<PostCommentVo> query(Integer id){
        List<PostCommentVo> list = baseBiz.query(id);
        Map<String, Object> data = new HashMap<>(1);
        data.put("list",list);
        return new ObjectRestResponse<>().rel(true).data(data);
    }

}